﻿using System;
using UnityEngine;

// Token: 0x0200000F RID: 15
public class DeathScoreGiver : MonoBehaviour
{
	// Token: 0x06000040 RID: 64 RVA: 0x000084BE File Offset: 0x000066BE
	private void Start()
	{
		this.body = base.GetComponent<BodyScript>();
		if (!GameManager.main.arena && !this.keepOutsideArena)
		{
			Object.Destroy(this);
		}
	}

	// Token: 0x06000041 RID: 65 RVA: 0x000084EC File Offset: 0x000066EC
	private void Update()
	{
		if (!this.body.alive)
		{
			Object.Destroy(this);
			GameManager.main.AddExp(this.scoreOnDeath);
			if (this.achievementType == 1 && GameManager.main.isArena)
			{
				PauseManager.main.TryUnlockAchievement(13);
				return;
			}
			if (this.achievementType == 2)
			{
				PauseManager.main.TryUnlockAchievement(16);
				return;
			}
			if (this.achievementType == 3)
			{
				PauseManager.main.TryUnlockAchievement(18);
			}
		}
	}

	// Token: 0x040000D2 RID: 210
	public int scoreOnDeath;

	// Token: 0x040000D3 RID: 211
	private BodyScript body;

	// Token: 0x040000D4 RID: 212
	public int achievementType;

	// Token: 0x040000D5 RID: 213
	public bool keepOutsideArena;
}
